import java.time.*;
import java.time.format.*;
import java.time.temporal.*;

public class GPTDateTime {
    public String[] getStartEndTime() {
        //获取基准时间
        LocalDateTime now = LocalDateTime.now();
        //步骤一:开始时间计算
        LocalDateTime startTime = now.minusDays(1).toLocalDate().atTime(${startnumberHour}, ${startnumberMin}, 0);
        //步骤二:结束时间计算
        LocalDateTime endTime = now.minusDays(1).toLocalDate().atTime(${endnumberHour}, ${endnumberMin}, 0);
        //步骤三:格式化开始时间,结束时间
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String startTimeStr = formatter.format(startTime);
        String endTimeStr = formatter.format(endTime);
        //步骤四:返回数组
        return new String[]{startTimeStr, endTimeStr};
    }
}